# coding: utf-8
from . import db, BaseModel

from .psy_consultant import PsyConsultant




class Introduction(db.Model):
    __tablename__ = 'introduction'

    auto_id = db.Column(db.BigInteger, primary_key=True, info='自增id')
    psy_id = db.Column(db.ForeignKey('psy_consultant.psy_id'), index=True, info='咨询师id')
    content = db.Column(db.String(255, 'utf8mb4_0900_ai_ci'), server_default=db.FetchedValue(), info='简介内容')
    is_delete = db.Column(db.Integer, server_default=db.FetchedValue(), info='是否已删除')
    create_time = db.Column(db.DateTime, server_default=db.FetchedValue(), info='创建时间')
    update_time = db.Column(db.DateTime, server_default=db.FetchedValue(), info='更新时间')

    psy = db.relationship('PsyConsultant', primaryjoin='Introduction.psy_id == PsyConsultant.psy_id', backref='introductions')
